package sv.gob.mtps.sib.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import sv.gob.mtps.sib.dto.rpt.ReporteInventarioGeneral;
import sv.gob.mtps.sib.model.Factura;
import sv.gob.mtps.sib.service.FacturaService;
import sv.gob.mtps.sib.service.FondosService;

@Controller
public class ReportesController {

	@Autowired
	private FacturaService facturaServices; 
	@Autowired
	private FondosService fondoServices;
	
	@RequestMapping(value = "/admin/showReports")
	public  String showReports(@ModelAttribute("factura") Factura factura,BindingResult result,Map<String, Object> map){				
		return "admin/reportes";		
	}
	
	@RequestMapping(value = "/admin/reporteInvGeneral")
	public  String reporteInvGeneral(@ModelAttribute("rptInventarioGenearl") ReporteInventarioGeneral rptInventarioGenearl,BindingResult result,Map<String, Object> map){		
		map.put("bodega",facturaServices.listBodega());
		map.put("fondo",fondoServices.listFondo());
		return "admin/rpt_inventarioGeneral";		
	}
	
	
	@RequestMapping(value = "/admin/reporteFacturas")
	public  String reporteFacturas(@ModelAttribute("rptInventarioGenearl") ReporteInventarioGeneral rptInventarioGenearl,BindingResult result,Map<String, Object> map){		
		
		return "admin/rpt_saldosFacturas2f";		
	}
	
	
	@RequestMapping(value = "/admin/saldosBodega")
	public  String saldosBodega(@ModelAttribute("rptInventarioGenearl") ReporteInventarioGeneral rptInventarioGenearl,BindingResult result,Map<String, Object> map){		
		
		return "admin/rpt_saldosBodega";		
	}
	
	
	
	
}
